import json
# 1.字典 转换为 JSON字符串, 方法: json.dumps(字典)
dict1 = {
    "name": "zhangsan",
    "age": 18,
    "is_man": True,
    "school": None
}
json1 = json.dumps(dict1)
print(json1)

# 2.把JSON字符串转换为字典, 方法: json.loads(JSON字符串)
json2 = '{"name": "zhangsan", "age": 18, "is_man": true, "school": null}'
dict2 = json.loads(json2)
print(dict2)